package com.ljl.mvvmdemo.db.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.ljl.mvvmdemo.db.entity.Login

@Dao
interface LoginDao {

    @Insert
    suspend fun insertLogin(login: Login)

    @Query("select * from Login")
    suspend fun getAllLogin(): List<Login>

    suspend fun getLogin(): Login? {
        return getAllLogin().firstOrNull()
    }

}